is_test = False
unit = 5 if is_test else 60

# # Runtime Params
wait_params = {
    # # base
    'timeout': 5,             # gevent timeout
    
    'user_sync_time': 0.1,    # obs*2
    'user_density_time': 0.1, # obs*0.5

    'mt_sync_time': 1,        # obs*2
    'mt_density_time': 1,     # obs*0.5

    'overflow_time': 0.1,     # 20*2/s
    'activate_time': 0.1,     # 2/s,
    'aux_time': 0.1,          # 2+2+1+3+1+5=14/s, 
    'quantity_time': 1,       # 5/s

    # # adv
    'pricing_time': 0,
    'optimal_time': 60*unit,
    'control_time': 60*unit,
    'autopt_time': 60*unit,

    # # aux
    'risk_metrics_time': 60*unit,
}

optimal_params = {
    # balance
    'balance_density': {
        'max_ratio': 0.1,
    },
    'balance_spread': {
        'max_ratio': 0.1,
    },
    # position
    'position_density': {
        'max_ratio': 0.05,
    },
    'position_spread': {
        'max_ratio': 0.05,
    },
    # loss
    'balance_loss': {
        'max_loss': 0.8,
    },
    'episode_loss': {
        'max_loss': 0.1,
        'episode': 60*60*12,
    }
}

redis_optimal_state = '_optimal_state'
optimal_status = {
    'forever_stop_liquid': False,   # bool
    'temp_stop_liquid': 0,          # time unit second
    'stop_process': False,          # bool
    'temp_sub_liquid': 0,           # relative ratio
}
